#pragma once
#ifndef OBR_SHADER_MATHDATAUTILS_CUH
#define OBR_SHADER_MATHDATAUTILS_CUH

#include "../common.cuh"

#ifndef M_PIf
#define M_PIf 3.14159265358979323846f
#endif
#ifndef M_PI_2f
#define M_PI_2f 1.57079632679489661923f
#endif
#ifndef M_1_PIf
#define M_1_PIf 0.318309886183790671538f
#endif
#ifndef M_PI2f
#define M_PI2f 9.86960440108935861883f
#endif

static __forceinline__ __device__ void set_float3_at(float3 *dest, float val, int idx)
{
    if (idx == 0)
    {
        dest->x = val;
    }
    if (idx == 1)
    {
        dest->y = val;
    }
    if (idx == 2)
    {
        dest->z = val;
    }
}
static __forceinline__ __device__ float get_float3_at(float3 *dest, int idx)
{
    if (idx == 0)
    {
        return dest->x;
    }
    if (idx == 1)
    {
        return dest->y;
    }
    if (idx == 2)
    {
        return dest->z;
    }
    return 0;
}

#endif
